public class Main {
    public static void main(String[] args) {

        char[] arr = {'d','e','d','h','d','l','e'};
        int[] count = new int[128];
        for (int i = 0; i < arr.length; ++i) {
            System.out.println(count[arr[i]]++);
        }

       return ;
    }

}
